<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>Serrano 1.0</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<link rel="stylesheet" href="css/screen.css" type="text/css" media="screen" />
	
	<link type="text/css" href="css/custom-theme/jquery-ui-1.8.16.custom.css" rel="Stylesheet" />
   <script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
   <script type="text/javascript" src="js/jquery-ui-1.8.16.custom.min.js"></script>
   	<script type="text/javascript" src="js/jquery.ui.datepicker-es.js"></script>    
</head>
<body>
	<div class="wrap" id="wrap">
    <div class="header" id="header">
        <h2>Serrano 1.0 - Consultas</h2>
        <h3>Sistema transitorio de consultas breves e informes</h3>
        <input name="busqueda" id="busqueda" placeholder="Buscar">
  			<input type="submit" value="Buscar">
    </div>
    <div class="header" id="calendario">
		 	<p>Cargas</p>
		 	<input type="text" name="fecha" id="campofecha"> 
    </div>
    <div class="sidebar" id="sidebar">
      <ul>
      	<il><a href="admin.php" >Modificar y borrar</a></il>
        <il><a href="buscar.php" >buscar</a></il>
       </ul>
    </div>
    <div class="content" id="content">

    </div>
    <div class="nav" id="nav">
	    <ul>
	    	<li><a href="index.php" class="active">Inicio</a></li>
	    	<li><a href="#"  >Consultas</a></li>
	    	<li><a href="#" >Informes</a></li>
	    </ul>
  	</div>
    <div class="resultados"  id="resultados">

<table>
	<tr>
		<th> DNI </th>
		<th> LP </th>
                <th> Apellido </th>
                <th> Nombre </th>
                <th> Grado </th>
                <th> Historial </th>
                <th> Borrar </th>
                <th> Editar </th>
	</tr>
		
<?php

  require_once('appvars.php');
  require_once('connectvars.php');

  if (isset($_GET['DNI'])) {
    // Grab the score data from the POST
    $DNI = $_GET['DNI'];

  }
  
  
  
  // Connect to the database 
  $dbc = mysqli_connect('localhost', 'serrano' ,'serrano', 'escalafon');

  if (isset($_POST['DNI'])) {
    // Grab the score data from the POST
    $DNI = $_POST['dni'];
  }
  
  // Retrieve the score data from MySQL
  $query = "SELECT * FROM GENERAL where DNI='$DNI'";
  $data = mysqli_query($dbc, $query);
  
        while ($fila = mysqli_fetch_row($data)){
                print "<tr>";
                    print "<td>" . $fila[3] . "</td>";
                    print "<td>" . $fila[14] . "</td>";
                    print "<td>" . $fila[1] . "</td>";
                    print "<td>" . $fila[2] . "</td>";
                    print "<td>" . $fila[8] . "</td>";
                    print "<td>" . $fila[13] . "</td>";
                    print "<td><a href=\"removescore.php?DNI=" . $fila['3'] . "&amp;Apellido=" . $fila['1'] . "&amp;Nombre=" . $fila['2'] . "&amp;LP=" . $fila['14'] . "&amp;Grado=" . $fila['8'] . "\">Remove</a></td>";
                    print "<td><a href=\"editPersona.php?DNI=" . $fila['3'] . "&amp;Apellido=" . $fila['1'] . "&amp;Nombre=" . $fila['2'] . "&amp;LP=" . $fila['14'] . "&amp;Historial=" . $fila['13'] . "\">Editar</a></td>";
                print "<\tr>";
        }

                echo('</table>');
        mysqli_close($dbc);
?>
    </div>


  	<div class="footer" id="footer">
  		<?php echo date	?>
  		<p>Copyright &copy; 2011, LoserPals, all rights reserved.</br>
    	Puede tener fecha y hora tipo widget. y tal vez nombre de usuario</br></p>
    	        
    </div>
  </div>

    </div>
</body>
</html>